<?php
$curr_page =3;
include 'head.php';
if(isset($_GET['id']))
{
	$id = $_GET['id'];
}
 $sql = "select a.id,a.name,a.model,a.type_id,a.price,a.path,a.remark,a.content,a.dates,a.ishot,a.isnews from product as a where a.flag =1 and a.id=".$_GET['id'];
	
 $result = mysql_query($sql);
	$row = mysql_fetch_array($result);
?>
<head>
<link href="1.css" rel="stylesheet" type="text/css" />
</head>

		<!--页面-->
		<div id="ym1" style="background:#FFFFFF;">
				<!--主要内容-->
				<div style="background:#FFFFFF; width:960px;  padding-bottom:16px;">
					
						<!--内容左-->
						<div  style="width:648px; float: left; margin-left:17px;">
							
							<div class="right" style="background: url(images/xw_nrt7.jpg); margin-top:16px;width:648px; height:33px; float: left;">
								<h1 style="text-indent:16px; margin-top:10px;">相关下载</h1>
							</div>
							
							
							
							<!--列表-->
							<div style=" border:1px solid #c8c8c8; float:left; margin-top:-1px; width:646px; padding-bottom:50px;">
								
								<!--标题详情-->
								<div>
									<div style="width:210px; height:120px; float:left; margin:15px 0 0 15px;"><img style="width:204px;height:147px;" src="<?php echo $row['path']?>"/></div>
									<div style=" width:350px; height:134px; float:right;  margin:50px 30px 0 0; ">
									
										 <div style="line-height:30px;">
											 <span>产品名称：</span><span style="color:#81a615; font-weight:bold;"><a style="color:#81a615; font-weight:bold;" href="<?php echo "product_info.php?id=".$row['id'];?>"><?php echo $row["name"]?></a></span>
										 </div>
									     <div>
									        <span style="">产品型号：</span><span style="color:#81a615; font-weight:bold;"><?php echo $row["model"];?></span>
									     </div>
										 <div style="width:325px; line-height:20px; text-indent:2em; margin-top:10px;">
												<span><?php echo $row["remark"]?></span>
										 </div>
								
								    </div>
								    <div style="clear:both;"></div>
								</div>
								
								<!--标题详情-->
								
								<?php 
								
									$sql = "select id,name,flag from download_type where flag =1";
									$result1 = mysql_query($sql);
									
								while($row1 = mysql_fetch_array($result1))
								{
								?>
									
									<div style="background-color:#f1f1f1; width:616px; height:28px; font-family:'宋体'; font-size:12px; color:#393939; margin-left:15px;margin-top:15px;">
										<div style="background:url(images/fx.jpg); background-repeat:no-repeat;width:13px; height:16px; float:left; margin:7px 0 0 7px;"></div>
											<span style="line-height:28px; float:left; margin-left:12px;"><?php echo $row1["name"]?></span>
											
											<span style="line-height:28px; float: right; margin-right:12px; color:#336699"></span>
							 		</div>
							 		<table style="line-height:20px;margin-left:15px;margin-top:15px;" width="95%">
										<tr>
				                           <th width="30%">名称</th>
				                           <th width="10%">产品型号</th>
				                           <th width="30%">产品名称</th>
				                           <th width="10%">更新日期</th>
				                           <th width="10%">下载链接</th>
				                           <th width="10%">下载次数</th>
				                        </tr>
							 			<?php
							 			    $sql = "select a.id as down_id,
			                                    b.id as pro_id, 
			                                    a.name as down_name,
			                                    a.url as down_url,
			                                    b.name as pro_name,
			                                    b.model as pro_model,
			                                    a.dates as down_dates,
			                                    a.counts as down_counts
			                                    from download as a inner join product as b on a.pro_id =b.id where a.flag =1 and a.type_ = ".$row1['id']." and a.pro_id=".$row["id"]." order by down_dates desc"; 
							 				//$sql = "select id,name,url,remark,counts,dates,type_,size from download where flag =1 and type_ = ".$row1["id"]." and pro_id = ".$row["id"];
							 				
							 				$result2 = mysql_query($sql);
							 				while($row2 = mysql_fetch_array($result2))
							 				{
							 					
							 			
							 			?>
										<tr>
			                                <td style="width:180px;" align="center"><a style="text-decoration:none;color:black" href="downloaddetail.php?pro_id=<?php echo $row2['pro_id']?>&down_id=<?php echo $row2['down_id']?>" ><?php echo $row2['down_name']?></a></td>
			                                <td style="width:200px;" align="center"><a style="text-decoration:none;color:black" href="download1.php?id=<?php echo $row2['pro_id']?>" ><?php echo $row2['pro_model']?></a></td>
			                                <td style="width:60px" align="center"><a style="text-decoration:none;color:black" href="product_info.php?id=<?php echo $row2['pro_id']?>" ><?php echo $row2['pro_name'];?></a></td>
			                                <td  align="center"><?php echo $row2['down_dates']?></td>
			                                <td style="font-weight:bold;" align="center"><a style="color:#81a615;text-decoration:none;" href="<?php echo $row2['down_url']?>">点击下载</a></td>
			                                <td style="width:80px;text-align:center;" align="center"><?php echo $row2['down_counts'] ?>次</td>
			                            </tr>
									
								<?php
							 				}
							 	?>
							 	</table>
							 	<?php
								}
								?>
						
								
					
                    		</div>
							<!--列表-->
			
                         </div>
					   	<!--内容左-->
								
								<!--内容右-->
								<div style=" float:left;margin-left:15px; width:263px;">
									
									<div style="background:url(images/xw_nrt_3.jpg); width:263px; height:33px; float:left; margin-top:16px;">
										<h1 style="margin:10px 0 0 12px;"><span style="margin-right:9px;"><img src="images/xw_lbarxl.png"/></span>热门下载</h1>
									</div>
									
									<div style="border:1px solid #c8c8c8;float:left; margin-top:-1px;">
										<div style="float:left; margin-bottom:20px;">
																					<div style="float:left; margin-top:20px; margin-bottom:20px;">
										<?php
										  $sql = "select * from download order by counts desc LIMIT 0 , 5 ";
										  $ret = mysql_query($sql);
										  
										  while($row = mysql_fetch_array($ret)){
										?>
											<h2 style="color:#393939; margin:5px 20px 0px 16px; display:block;width:210px;"><span style="margin-right:4px;"><img src="images/xw_bd.jpg"/></span><a href="<?php echo "downloaddetail.php?pro_id={$row['pro_id']}&down_id={$row['id']}"?>"><?php echo $row['name']?></a></h2>
									     <?php }?>
										</div>
										</div>
										
									</div>
									<div style="background: none; width:264px; height:321px;margin-top:15px; float:left;">
									 <?php
									   $sql = "select * from ad where id = 3";
									   $ret = mysql_query($sql);
									   $rcd = mysql_fetch_array($ret);
									 ?>
									 <a href="<?php echo $rcd['link']?>" target='_blank'><img src="<?php echo $rcd['pic_path'];?>" /></a>
									</div>
									
								
								</div>
								
								
								<!--内容右-->
								
						
				<div style="clear:both;"></div>
				</div>
				<!--主要内容-->
				
				
			<div style="clear:both;"></div>
		</div>
		<!--页面-->
		 <?php include 'bottom.php';?>


